   <!DOCTYPE html>
   <html lang="en">
   <head>
       <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
       <title>Document</title>
       <script src="./js/jqery-3.5.1.min.js"></script>
   </head>
   <body>
    <script >
        function showImg(){
                // var img_file =  $("#img_file").val();
                var file =  document.getElementById('img_file').files[0];
                var re = new FileReader();
                re.readAsDataURL(file);
                re.onload = function(re){
                    $('#img_id').attr("src", re.target.result);
                }
            }
    </script>
<div class="layui-form-item">
  <label class="layui-form-label">图片地址</label>
  <div class="layui-input-block">
      <input type="hidden" id="img_url">
      <input type="file" onchange="showImg()" id="img_file"><img src="" alt="" id="img_id" style="width: 100px">
    </div>
</div> 
   </body>
   </html>